<#include "../common/templet.html"/> <@layout>
<div class="container">
	<div class="row">
		<div class="page-header">
			<h2 class="sub-header">
				用户列表
				<a
					type="button"
					class="btn btn-primary"
					href="${ctx!}/admin/user/edit?role=manager">新增管理员</a>
			</h2>
			<div>
				<form class="form-inline" action="${ctx!}/admin/user/query" method="post">
				  <div class="form-group">
				    <input type="text" class="form-control" name="userName" placeholder="账号">
				  </div>
				  <div class="form-group">
				    <input type="text" class="form-control"  name="realName" placeholder="姓名">
				  </div>
				  <button type="submit" class="btn btn-primary">查 询</button>
				</form>
			</div>
		</div>
		<div class="table-responsive">
			<table class="table table-striped">
				<thead>
					<tr>
						<th>账号</th>
						<th>角色</th>
						<th>是否有效</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<#list userList as user>
					<tr>
						<td>${user.userName?if_exists}</td>
						<td>${user.role?if_exists }</td>
						<td>${(user.valid?if_exists='1')?string('是','否')}</td>
						<td>
							<a
								href="${ctx!}/admin/user/edit?id=${user.id}"
								title="编辑">
								<span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span>
							</a>
							&nbsp;
							<a 
								href="javascript:deleteData('${ctx!}/admin/user/delete?id=${user.id}');"
								title="删除">
								<span
									class="glyphicon glyphicon-remove"
									aria-hidden="true"></span>
							</a>
						</td>
					</tr>
					</#list>
				</tbody>
			</table>
		</div>
	</div>
</div>
</@layout>
